package com.itcast.springboot.waste_recovery.service.impl;

import com.itcast.springboot.response.SearchRes;
import com.itcast.springboot.waste_recovery.domain.WasteData;
import com.itcast.springboot.waste_recovery.mapper.WasteDataMapper;
import com.itcast.springboot.waste_recovery.service.WasteDataService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 垃圾数据表 服务实现类
 * </p>
 *
 * @author 小破烂
 * @since 2020-08-19
 */
@Service
public class WasteDataServiceImpl extends ServiceImpl<WasteDataMapper, WasteData> implements WasteDataService {
    @Resource
    WasteDataMapper wasteDataMapper;

    @Override
    public List<SearchRes> search(String wasteName) {
        List<SearchRes> searchResList = wasteDataMapper.search(wasteName);
        return searchResList;
    }

    @Override
    public List<WasteData> getWasteDatas() {
        List<WasteData> wasteDatas = wasteDataMapper.selectList(null);
        return wasteDatas;
    }
}
